package com.example.utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MapConverter {
    public static void main(String[] args) {
        // 创建示例数据
        List<Map<String, String>> inputList = new ArrayList<>();
        
        Map<String, String> entry1 = new HashMap<>();
        entry1.put("key", "type");
        entry1.put("value", "1");
        
        Map<String, String> entry2 = new HashMap<>();
        entry2.put("key", "status");
        entry2.put("value", "4545");
        
        inputList.add(entry1);
        inputList.add(entry2);
        
        // 转换方法
        Map<String, String> result = convertListToMap(inputList);
        
        // 打印结果
        System.out.println(result);
    }
    
    public static Map<String, String> convertListToMap(List<Map<String, String>> inputList) {
        Map<String, String> result = new HashMap<>();
        
        for (Map<String, String> entry : inputList) {
            String key = entry.get("key");
            String value = entry.get("value");
            result.put(key, value);
        }
        
        return result;
    }
} 